﻿@model Cadcam7Moddel.Model.Trang

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>


@System.Web.Optimization.Scripts.Render("~/ckeditor/ckeditor.js")
@System.Web.Optimization.Scripts.Render("~/ckeditor/config.js")
@System.Web.Optimization.Scripts.Render("~/ckfinder/ckfinder.js")
@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Trang Menu</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Tieude)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Tieude)
            @Html.ValidationMessageFor(model => model.Tieude)
        </div>

        

        <div class="editor-label">
            @Html.LabelFor(model => model.Tomtac)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Tomtac)
            @Html.ValidationMessageFor(model => model.Tomtac)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Noidung)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Noidung)
            @Html.ValidationMessageFor(model => model.Noidung)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Hien)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Hien)
            @Html.ValidationMessageFor(model => model.Hien)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.Thutu)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Thutu)
            @Html.ValidationMessageFor(model => model.Thutu)
        </div>
         <div class="editor-label">
            @Html.LabelFor(model => model.Trangchu)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Trangchu)
            @Html.ValidationMessageFor(model => model.Trangchu)
        </div>
        

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#btnselectimage").click(function () {
            var finder = new CKFinder();
            finder.selectMultiple = true;
            finder.selectActionFunction = function (fileUrl, data) {

                $('#Img').val(fileUrl);
                $('#imgshow').attr("src", fileUrl)
            };
            finder.popup();
        });
    });
</script>
<script type="text/javascript">
    
    var ck2 = CKEDITOR.instances['Noidung'];
    if (ck2)//check if instance exist
    {
        CKEDITOR.remove(ck);
    }
    CKEDITOR.replace('Noidung', {
        autoGrow_maxHeight: 300,
        removePlugins: 'resize',
        enterMode: CKEDITOR.ENTER_BR,
        filebrowserBrowseUrl: '@Url.Content("~/ckfinder/ckfinder.html")',
        filebrowserImageBrowseUrl: '@Url.Content("~/ckfinder/ckfinder.html?type=Images")',
        filebrowserUploadUrl: '@Url.Content("~/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files")',
        filebrowserImageUploadUrl: '@Url.Content("~/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images")',
        filebrowserWindowWidth: 800,
        filebrowserWindowHeight: 500,
        toolbar:
		    [
		        { name: 'document', items: ['DocProps', 'Preview', 'Print', '-', 'Templates'] },
	            { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
	            { name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'] },
                { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
	            '/',
                { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
	            { name: 'colors', items: ['TextColor', 'BGColor'] },
	            { name: 'tools', items: ['Maximize', 'ShowBlocks'] },
                '/',
	            { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] },
	            { name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
	           { name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'] }
		    ]
    });
</script>










